

import { defineStore } from "pinia";

export const GoodStore = defineStore('user',{

        //开启数据持久化
        persist:true,

        state:()=>{
            return {
                token:'',//token数据,
                username:'',//用户名称
            }
        },

        actions:{
            setToken(payload){
                this.token=payload;
            },
            setusername(payload){
                this.username=payload;
            },
            delToken(){
                this.token='';
                this.username=''
            }
        }

})
